Govstack API: filter work orders and runs via REST API by UUIDs or status#4553
Govstack API: filter work orders and runs via REST API by UUIDs or status#4553taylordowns2000 merged 10 commits intomainfrom
Conversation
Code Review: Work Orders API — ID Filter & Show ActionOverviewThree files changed: added an 1. Status Codes: 401 vs 403Finding: 401 is consistent with the codebase, but technically wrong per HTTP spec. The chain works like this:
Every API controller ( Per RFC 7235, 401 means "not authenticated" and 403 means "authenticated but not authorized". The entire API layer has this backwards — but our test asserting 401 is consistent with the existing pattern. This is a pre-existing issue, not something introduced by this PR. If you want to fix it platform-wide, that's a separate effort. 2. Authorization PoliciesFinding: Authorization is correct. The
Role coverage: The One gap worth noting: There is no test for the 3. Regression Risk AnalysisRisk: Very Low
No impact on:
One minor code quality note: The Summary
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4553 +/- ##
==========================================
+ Coverage 89.64% 89.76% +0.12%
==========================================
Files 444 444
Lines 21627 21660 +33
==========================================
+ Hits 19387 19443 +56
+ Misses 2240 2217 -23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
stuartc
left a comment
There was a problem hiding this comment.
Please resolve the duplicate test files for the controller, LightningWeb.API.WorkflowsControllerTest.
And trim or remove the curl examples in the tests. My opinion is that they are noise, happy to keep them if you don't agree.
…rdcoding Expose Run.states/0 and WorkOrder.states/0 as public functions so consumers derive valid states from the schema rather than duplicating them. Update Invocation.Query to use these functions instead of hardcoded ~w() lists. Remove duplicate curl example comments from API controller test files (canonical versions remain in controller moduledocs).
46d841b to
ece5fab
Compare
Security ReviewS0: Project-Scoped Data Access
S1: Authorization Policies
S2: Audit Trail Coverage
SummaryThe PR is read-only (new |
Description
This PR closes #4552 by adding tests for the
showcase on the work order REST API and adding the ability to pass a list of IDs into theindexcase on the work order REST API.Validation steps
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)